<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script type="text/javascript" src="Vue-v2.5.22.js"></script>
    <script type="text/javascript" src="Vue-resource-v1.5.1.js"></script>
    <title>Title</title>
</head>
<body>
<div id="box">
    <input type="button" @click="get()" value="点我异步获取数据(Get)">
</div>
<script type = "text/javascript">
    window.onload = function(){
        var vm = new Vue({
            el:'#box',
            data:{
                msg:'Hello World!',
            },
            methods:{
                get:function(){
                    //发送get请求
                    this.$http.get('/ajax_info.txt').then(function(res){
                        document.write(res.body);
                    },function(){
                        console.log('请求失败处理');
                    });
                }
            }
        });
    }
</script>
</body>
</html>